#ifndef _TIMER_H_
#define _TIMER_H_

#include <time.h>
namespace fe
{
    /**************************************************************************
    * the timer class basically keeps track of time, when it restarts it just
    * sets the last time to the current time then when you call the
    * getElapsedTime it updates the current time and offsets the lastTime and
    * returns the answer
    **************************************************************************/
    class Timer
    {
    public:
        // constructor
        Timer();

        // i usually dont comment this much but you said to so i am :D
        // sets the last time to the current time ( resets the timer )
        void  restart();

        // returns the time in seconds
        inline float getElapsedTime()
        {
            time(&m_currentTime);
            return static_cast<float>(m_currentTime - m_lastTime);
        }

        // returns the time in milliseconds
        inline long  getMilSec()
        {
            time(&m_currentTime);
            return ((m_currentTime - m_lastTime)*1000);
        }

    private:
        time_t m_currentTime;
        time_t m_lastTime;
    };
}

#endif
